---
layout: "default"
title: "sizeof"
description: "Swift documentation for 'sizeof': Returns the contiguous memory footprint of T."
keywords: "sizeof,func,swift,documentation"
root: "/v2.0"
---

<div class="declaration" id="func-sizeof-t_-t-type">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-sizeof-t_-t-type">func sizeof&lt;T&gt;(<wbr>_: T.Type)</a>
        
<div class="comment collapse" id="comment-func-sizeof-t_-t-type"><div class="p">
    <p>Returns the contiguous memory footprint of <code>T</code>.</p>

<p>Does not include any dynamically-allocated or &quot;remote&quot; storage.
In particular, <code>sizeof(X.self)</code>, when <code>X</code> is a class type, is the
same regardless of how many stored properties <code>X</code> has.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func sizeof&lt;T&gt;(_: T.Type) -&gt; Int</code>
    
    
</div></div>
</div>
